home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19950528-19950726 / 000041_news@columbia.edu_Thu Jun 1 14:23:26 1995.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA09230
  2.   (5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Fri, 2 Jun 1995 20:38:00 -0400
  3. Received: by apakabar.cc.columbia.edu id AA06247
  4.   (5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Fri, 2 Jun 1995 20:37:59 -0400
  5. Path: news.columbia.edu!sol.ctr.columbia.edu!howland.reston.ans.net!math.ohio-state.edu!uwm.edu!lll-winken.llnl.gov!osi-east2.es.net!oracle.pnl.gov!mica.inel.gov!pmafire!mars.poci.amis.com!cwis.isu.edu!news.cc.utah.edu!news.cs.utah.edu!cc.usu.edu!jrd
  6. From: jrd@cc.usu.edu (Joe Doupnik)
  7. Newsgroups: comp.protocols.kermit.misc
  8. Subject: Re: Piping output from "rem host" command
  9. Message-Id: <1995Jun1.202326.53054@cc.usu.edu>
  10. Date: 1 Jun 95 20:23:26 MDT
  11. References: <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>
  12. Organization: Utah State University
  13. Lines: 33
  14. Apparently-To: kermit.misc@watsun.cc.columbia.edu
  15.  
  16. In article <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>, "John D. Tucker" <tucker@mickey.acs.wmich.edu> writes:
  17. > I would like to send a command to a remote computer and capture a brief 
  18. > (one line of characters) response from that computer for processing 
  19. > within a script.  Reading the "Using MS-DOS Kermit" manual, I found that 
  20. >                rem host [command] > d:\log\remote.out
  21. > would capture the output from "[command]" in the file "d:\log\remote.out".
  22. > However, when using the pipe symbol (instead of the redirection symbol), 
  23. > the symbol gets sent to the remote host rather than piping the output to 
  24. > some program.
  25. ------------
  26.     Piping will never work because it presumes that programs are
  27. under control of the current Command.com and use stdin/stdout to read
  28. and write. DOS uses a file to represent the pipe. In addition, MS-DOS Kermit
  29. server (the receiving end of the initial command) performs remote host 
  30. commands by invoking command.com #2 with the command line supplied by the 
  31. client, and the output is redirected to a temporary file. The temp file is 
  32. necessary so Kermit can read the results, if any, and send them back to the
  33. client. That means there is already a redirection supplied by Kermit, and 
  34. it means Command.com #2 is not in charge of Kermit.
  35.     If you supply a redirection then that is sent to the remote host
  36. (Kermit server) and the file to which you write is on that host too. MSK
  37. does not know you have supplied redirection so MSK reads only it's own
  38. temp file. 
  39.     The material comes back as a file, and we can't stuff a file into 
  40. a Kermit variable. You can "get filename" and obtain a local file copy
  41. to which you may apply Kermit script string operations (read, string ops,
  42. etc). Be aware that most DOS programs do not use stdin/stdout to work.
  43. They go straight to hardware and below the Bios, so you won't capture much
  44. in that redirection, and you can lock up the server machine while the target 
  45. program waits on the real keyboard, etc.
  46.     Joe D.